<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="btn">1</button>
</body>
<script>
    var btn=document.getElementById('btn')
    console.log(btn.innerText);
    btn.onclick=function(){
        alert(parseInt(btn.innerText)+1)
        btn.innerText=parseInt(btn.innerText)+1

    }
</script>
</html>